#!/bin/sh

export CXX=g++
export CC=gcc

rm -rf hiredis-vip-master
rm -rf Include
rm -rf Lib

unzip hiredis-vip-master.zip
cd hiredis-vip-master
make

# 查看目标文件是否已生成
if [ ! -f libhiredis_vip.a ]; then
    echo 'Failed to compile libhiredis_vip.a';
    exit 1;
fi

# 将静态库文件拷贝到目标目录
mkdir ../Include ../Lib
cp -rf libhiredis_vip.a ../Lib/
cp -rf *.h ../Include/
